package mapping

import (
	"maya-service/model"
	"maya-service/model/entity"
)

// QuestionsEntityToDto entity data transfer
func QuestionsEntityToDto(questions []*entity.Question) []*model.QuestionInfo {
	out := make([]*model.QuestionInfo, 0, len(questions))
	for _, c := range questions {
		out = append(out, QuestionEntityToDto(c))
	}
	return out
}

// QuestionEntityToDto entity data transfer
func QuestionEntityToDto(e *entity.Question) *model.QuestionInfo {
	return &model.QuestionInfo{

		Id: e.Id,

		Title: e.Title,

		Type: e.Type,

		Image: e.Image,

		AnswerId: e.AnswerId,

		LevelId: e.LevelId,

		CreatedAt: e.CreatedAt,

		UpdatedAt: e.UpdatedAt,
	}
}
